<html>
<head>
    @include('v1.common.meta')
    <link rel="stylesheet" href="{{elixir('css/basicdata.css')}}">
</head>
<body>
<div class="yjs-grid">
    <div class="yjs-grid-box">
        <div class="layui-tab">
            @if(Auth::check())
                <div class="layui-container">
                    @if($view==='addData' && $type==='2')
                        {{--新增视频视图--}}
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <fieldset class="layui-elem-field">
                                    <legend>新增公告（视频）</legend>
                                    <div class="layui-field-box">
                                        <div class="layui-row hidden-tips">
                                            <div class="layui-col-md12">
                                                <blockquote class="layui-elem-quote">
                                                    温馨提示：新增数据时，存在"<i class="layui-icon">&#xe605;</i>"标识的表单项，建议您自主编辑维护；
                                                </blockquote>
                                            </div>
                                        </div>
                                        <div class="layui-form layui-form-pane" name="noticeForm"
                                             action="javascript:;" method="POST">
                                            <input type="hidden" name="viewType" value="{{$view}}">
                                            <input type="hidden" name="contentType" value="{{$type}}">
                                            <input type="hidden" name="code" value="{{$randomCode}}">
                                            <input type="hidden" name="publisher_code" value="{{$publisher}}">
                                            <input type="hidden" name="videoCoverPic" value="">
                                            <div class="layui-row">
                                                <!--<div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">公告代码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$randomCode}}" disabled
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>-->
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">内容类别</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="视频" disabled class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label"><i
                                                                    class="layui-icon">&#xe605;</i>所属栏目</label>
                                                        <div class="layui-input-inline">
                                                            <select id="program_code" name="program_code"
                                                                    lay-filter="programSel" lay-verify="required"
                                                                    lay-search="">
                                                                <option value="">直接选择或搜索选择</option>
                                                                @foreach($programs as $parent)
                                                                    <option value="{{$parent["code"]}}">{{$parent["name"]}}</option>
                                                                @endforeach
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label" style="width: 150px"><i
                                                                    class="layui-icon">&#xe605;</i>移动端是否显示</label>
                                                        <div class="layui-input-inline">
                                                            <input type="checkbox" name="isShow" value="1"
                                                                   lay-skin="switch" lay-text="是|否">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md12">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label"><i
                                                                    class="layui-icon">&#xe605;</i>公告标题</label>
                                                        <div class="layui-input-block">
                                                            <input type="text" name="title" required
                                                                   lay-verify="required|title"
                                                                   placeholder="请输入公告标题"
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md12">
                                                    <div class="layui-form-item layui-form-text">
                                                        <label class="layui-form-label"><i
                                                                    class="layui-icon">&#xe605;</i>视频封面</label>
                                                        <div class="layui-carousel" id="previewCarousel">
                                                            <div id="coverImages" carousel-item>
                                                            </div>
                                                        </div>
                                                        <div class="layui-input-block">
                                                            <div class="layui-upload">
                                                                <div class="layui-upload-list">
                                                                    <table class="layui-table">
                                                                        <thead>
                                                                        <tr>
                                                                            <th>编号</th>
                                                                            <th>文件名</th>
                                                                            <th>大小</th>
                                                                            <th>状态</th>
                                                                            <th>操作</th>
                                                                        </tr>
                                                                        </thead>
                                                                        <tbody id="imagesList"></tbody>
                                                                    </table>
                                                                </div>
                                                                <button type="button" class="layui-btn layui-btn-normal"
                                                                        id="btnChooseImages">选择封面图片
                                                                </button>
                                                                <button type="button" class="layui-btn"
                                                                        id="btnUploadImages">开始上传
                                                                </button>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md12">
                                                    <div class="layui-form-item layui-form-text">
                                                        <label class="layui-form-label"><i
                                                                    class="layui-icon">&#xe605;</i>视频简介&nbsp;&nbsp;&nbsp;&nbsp;<span
                                                                    style="color: red;"> 编辑规则：视频链接模板（封面上传成功后，系统自动生成）请通过工具条<span
                                                                        style="color: darkblue;"><i
                                                                            class="layui-icon layedit-tool-link">&#xe64c;</i></span>维护；视频简介内容换行后编辑维护</span></label>
                                                        <div class="layui-input-block">
                                                            <textarea class="layui-textarea layui-hide" name="content"
                                                                      lay-verify="content" id="notice_editor"></textarea>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">验证码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="captcha" maxlength="4"
                                                                   lay-verify="required"
                                                                   placeholder="请输入图片验证码" autocomplete="off"
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md3">
                                                    <div class="layui-form-item">
                                                        <img class="getLVcode" src="{{ captcha_src('mini') }}"
                                                             width="70px"
                                                             height="34px" style="border: 1px solid green;"/>
                                                        <div class="layui-form-mid layui-word-aux">
                                                            点击图片刷新验证码
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md3">
                                                    {{--隐藏提交--}}
                                                    <button id="toolbarSubmit" type="submit" class="layui-btn"
                                                            lay-filter="toolbarEvent" lay-submit style="display: none;">
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </fieldset>
                            </div>
                        </div>
                    @elseif($view==='editData' && $itemData['type']=='2')
                        {{--编辑视频视图--}}
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <fieldset class="layui-elem-field">
                                    <legend>编辑新闻（视频）</legend>
                                    <div class="layui-field-box">
                                        <div class="layui-row hidden-tips">
                                            <div class="layui-col-md12">
                                                <blockquote class="layui-elem-quote">
                                                    温馨提示：编辑数据时，存在"<i class="layui-icon">&#xe605;</i>"标识的表单项，建议您自主编辑维护；
                                                </blockquote>
                                            </div>
                                        </div>
                                        <div class="layui-form layui-form-pane" name="noticeForm"
                                             action="javascript:;" method="POST">
                                            <input type="hidden" name="viewType" value="{{$view}}">
                                            <input type="hidden" name="code" value="{{$itemData['code']}}">
                                            <input type="hidden" name="contentType" value="{{$itemData['type']}}">
                                            <input type="hidden" name="publisher_code" value="{{$itemData['publisher_code']}}">
                                            <input type="hidden" name="videoCoverPic" value="">
                                            <div class="layui-row">
                                                <!--<div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">公告代码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['code']}}" disabled
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>-->
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">内容类别</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="视频" disabled class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label"><i
                                                                    class="layui-icon">&#xe605;</i>所属栏目</label>
                                                        <div class="layui-input-inline">
                                                            <select id="program_code" name="program_code"
                                                                    lay-filter="programSel" lay-verify="required"
                                                                    lay-search="">
                                                                <option value="">直接选择或搜索选择</option>
                                                                @foreach($programs as $parent)
                                                                    @if($itemData['program_code']===$parent['code'])
                                                                        <option value="{{$parent["code"]}}"
                                                                                selected>{{$parent["name"]}}</option>
                                                                    @else
                                                                        <option value="{{$parent["code"]}}">{{$parent["name"]}}</option>
                                                                    @endif
                                                                @endforeach
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label" style="width: 150px"><i
                                                                    class="layui-icon">&#xe605;</i>移动端是否显示</label>
                                                        <div class="layui-input-inline">
                                                            @if($itemData['topStatus'])
                                                                <input type="checkbox" name="isShow" value="1"
                                                                       checked
                                                                       lay-skin="switch" lay-text="是|否">
                                                            @else
                                                                <input type="checkbox" name="isShow" value="1"
                                                                       lay-skin="switch" lay-text="是|否">
                                                            @endif
                                                        </div>
                                                    </div>

                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md12">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label"><i
                                                                    class="layui-icon">&#xe605;</i>公告标题</label>
                                                        <div class="layui-input-block">
                                                            <input type="text" name="title"
                                                                   value="{{$itemData['title']}}" required
                                                                   lay-verify="required|title"
                                                                   placeholder="请输入公告标题"
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md12">
                                                    <div class="layui-form-item layui-form-text">
                                                        <label class="layui-form-label"><i
                                                                    class="layui-icon">&#xe605;</i>视频封面</label>
                                                        <div class="layui-carousel" id="previewCarousel">
                                                            <div id="coverImages" carousel-item>
                                                                <div><img src='{{$itemData['videoCoverPic']}}'></div>
                                                            </div>
                                                        </div>
                                                        <div class="layui-input-block">
                                                            <div class="layui-upload">
                                                                <div class="layui-upload-list">
                                                                    <table class="layui-table">
                                                                        <thead>
                                                                        <tr>
                                                                            <th>编号</th>
                                                                            <th>文件名</th>
                                                                            <th>大小</th>
                                                                            <th>状态</th>
                                                                            <th>操作</th>
                                                                        </tr>
                                                                        </thead>
                                                                        <tbody id="imagesList"></tbody>
                                                                    </table>
                                                                </div>
                                                                <button type="button" class="layui-btn layui-btn-normal"
                                                                        id="btnChooseImages">选择封面图片
                                                                </button>
                                                                <button type="button" class="layui-btn"
                                                                        id="btnUploadImages">开始上传
                                                                </button>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md12">
                                                    <div class="layui-form-item layui-form-text">
                                                        <label class="layui-form-label"><i
                                                                    class="layui-icon">&#xe605;</i>视频简介&nbsp;&nbsp;&nbsp;&nbsp;<span
                                                                    style="color: red;"> 编辑规则：视频链接模板（封面上传成功后，系统自动生成）请通过工具条<span
                                                                        style="color: darkblue;"><i
                                                                            class="layui-icon layedit-tool-link">&#xe64c;</i></span>维护；视频简介内容换行后编辑维护</span></label>
                                                        <div class="layui-input-block">
                                                            <textarea class="layui-textarea layui-hide" name="content"
                                                                      lay-verify="content" id="notice_editor">
                                                                {{$itemData['content']}}
                                                            </textarea>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
												<!--
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">验证码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="captcha" maxlength="4"
                                                                   lay-verify="required"
                                                                   placeholder="请输入图片验证码" autocomplete="off"
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md3">
                                                    <div class="layui-form-item">
                                                        <img class="getLVcode" src="{{ captcha_src('mini') }}"
                                                             width="70px"
                                                             height="34px" style="border: 1px solid green;"/>
                                                        <div class="layui-form-mid layui-word-aux">
                                                            点击图片刷新验证码
                                                        </div>
                                                    </div>
                                                </div>
												-->
                                                <div class="layui-col-md3">
                                                    {{--隐藏提交--}}
                                                    <button id="toolbarSubmit" type="submit" class="layui-btn"
                                                            lay-filter="toolbarEvent" lay-submit style="display: none;">
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </fieldset>
                            </div>
                        </div>
                    @else
                        {{--视图类型不正确--}}
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <blockquote class="layui-elem-quote-error">
                                    友情提示：视图类型不正确，无法支持后续操作。
                                </blockquote>
                            </div>
                        </div>
                    @endif
                </div>
            @else
                <div class="layui-container">
                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <blockquote class="layui-elem-quote-error">
                                友情提示：该功能只面向已成功登录系统，并具有相应权限的用户可用。
                            </blockquote>
                        </div>
                    </div>
                </div>
            @endif
        </div>
    </div>
</div>

@include('v1.common.js')
<script src="{{elixir('js/noticeItemVideo.js')}}"></script>
</body>
</html>